rendericon: Save and restore cairo matrix
authorBenjamin Otte <otte@redhat.com>
Wed, 6 Jan 2016 17:14:11 +0000 (18:14 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 11 Jan 2016 16:03:07 +0000 (17:03 +0100)
... instead of requiring cairo_save()/cairo_restore().

gtk/gtkrendericon.c

index 2c756a4929db8565d5b20d8d4e86388776d4d0fe..cacd5109c45fa1375d8d3636f963a0a0553fa84f 100644 (file)
@@ -39,7 +39,7 @@ gtk_css_style_render_icon (GtkCssStyle            *style,
                            GtkCssImageBuiltinType  builtin_type)
 {
   const GtkCssValue *shadows;
-  cairo_matrix_t matrix, transform_matrix;
+  cairo_matrix_t matrix, transform_matrix, saved_matrix;
   GtkCssImage *image;
 
   g_return_if_fail (GTK_IS_CSS_STYLE (style));
@@ -49,6 +49,8 @@ gtk_css_style_render_icon (GtkCssStyle            *style,
   if (image == NULL)
     return;
 
+  cairo_get_matrix (cr, &saved_matrix);
+
   shadows = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SHADOW);
 
   cairo_translate (cr, x, y);
@@ -75,6 +77,8 @@ gtk_css_style_render_icon (GtkCssStyle            *style,
           cairo_paint (cr);
         }
     }
+
+  cairo_set_matrix (cr, &saved_matrix);
 }
 
 gboolean